Private Declare Function fCreateShellLink Lib "VB5STKIT.DLL" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArguments As String) As Long
Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAnyOperationsAborted As Boolean
hNameMappings As Long
lpszProgressTitle As String ' only used if FOF_SIMPLEPROGRESS
End Type
Private Const FO_MOVE = &H1
Const FOF_RENAMEONCOLLISION = &H8
Public Function CreateFileShortcut(ByVal SrcFile As String, ByVal DestDir As String, ByVal DestFile As String, ByVal CalledHwnd As Long) As Boolean
'On Error GoTo FAILED
'Make Sure The Destdir Has A "\" On the end
If Not (Right(DestDir, 1) = "\") Then DestDir = (DestDir & "\")
'Make sure destfile hasn't a ".lnk" on the end
If LCase(Right(DestFile, 4)) = ".lnk" Then DestFile = Left(DestFile, Len(DestFile) - 4)